#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,l=1,r=1,k[N],Queue[N],flag[N];
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    memset(k,0,sizeof(k));
    memset(Queue,0,sizeof(Queue));
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>k[i];
        flag[k[i]]++;
    }

    if((flag[1]+flag[2])==n)
    {
        cout<<max(flag[1],flag[2])<<endl;
        return 0;
    }
    else
    {
        Queue[1]=k[1];
        sort(k+1,k+n+1);
        for(int i=2;i<=n;i++)
        {
            if(Queue[l]==k[i])
            {
                r++;
                Queue[r]=k[i];
            }
            if(Queue[l]<k[i])
            {
                Queue[l]=0;
                l++;
                r++;
                Queue[r]=k[i];
            }
        }
        cout<<r-l+1<<endl;
    }

    return 0;
}
